package com.ly.designpatten.single;

/**
 * @Classname EagerSingle
 * @Description TODO
 * @Date 2020/10/5 14:22
 * @Author 冷心影翼
 */
public class EagerSingle {

	private static EagerSingle eagerSingle = new EagerSingle();

	public static EagerSingle getInstance() {
		return eagerSingle;
	}

	private EagerSingle() {

	}
}

class TestEagerSingle {
	public static void main(String[] args) {
		EagerSingle eagerSingle1 = EagerSingle.getInstance();
		EagerSingle eagerSingle2 = EagerSingle.getInstance();
		System.out.println(eagerSingle1==eagerSingle2);
	}
}
